<ResourceDictionary 
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" >

  <ResourceDictionary.MergedDictionaries>
    <ResourceDictionary Source="Shared.xaml" />
  </ResourceDictionary.MergedDictionaries>

  <!-- SimpleStyles: ListBox -->
  <Style x:Key="{x:Type ListBox}" TargetType="ListBox">
    <Setter Property="SnapsToDevicePixels" Value="true"/>
    <Setter Property="OverridesDefaultStyle" Value="true"/>
    <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
    <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
    <Setter Property="ScrollViewer.CanContentScroll" Value="true"/>
    <Setter Property="MinWidth" Value="120"/>
    <Setter Property="MinHeight" Value="95"/>
    <Setter Property="Foreground" Value="{StaticResource ForegroundBrush}"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="ListBox">
          <Border 
            Name="Border" 
            Background="{StaticResource ItemsBackgroundBrush}"
            BorderBrush="{StaticResource SolidBorderBrush}"
            BorderThickness="1"
            CornerRadius="2">
            <ScrollViewer 
              Margin="0"
              Focusable="false">
              <StackPanel Margin="2" IsItemsHost="True" />
            </ScrollViewer>
          </Border>
          <ControlTemplate.Triggers>
            <Trigger Property="IsEnabled" Value="false">
              <Setter TargetName="Border" Property="Background"
                      Value="{StaticResource DisabledBackgroundBrush}" />
              <Setter TargetName="Border" Property="BorderBrush"
                      Value="{StaticResource DisabledBorderBrush}" />
            </Trigger>
            <Trigger Property="IsGrouping" Value="true">
              <Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  
  <!-- SimpleStyles: ListBoxItem -->
  <Style x:Key="{x:Type ListBoxItem}" TargetType="ListBoxItem">
    <Setter Property="SnapsToDevicePixels" Value="true"/>
    <Setter Property="OverridesDefaultStyle" Value="true"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="ListBoxItem">
          <Border 
            Name="Border"
            Padding="2"
            SnapsToDevicePixels="true">
            <ContentPresenter />
          </Border>
          <ControlTemplate.Triggers>
            <!--
            <Trigger Property="IsSelected" Value="true">
              <Setter TargetName="Border" Property="Background"
                      Value="{StaticResource SelectedFocusBackgroundBrush}"/>
            </Trigger>
            -->
            <MultiTrigger>
              <MultiTrigger.Conditions>
                <Condition Property="IsSelected" Value="true"/>
                <Condition Property="IsKeyboardFocused" Value="true"/>
              </MultiTrigger.Conditions>
              <Setter TargetName="Border"
                  Property="Background"
                  Value="{StaticResource SelectedFocusBackgroundBrush}"/>
              <Setter Property="Foreground" Value="{StaticResource SelectedForegroundBrush}"/>
            </MultiTrigger>
            <MultiTrigger>
              <MultiTrigger.Conditions>
                <Condition Property="IsSelected" Value="true"/>
                <Condition Property="IsKeyboardFocused" Value="false"/>
              </MultiTrigger.Conditions>
              <Setter TargetName="Border"
                  Property="Background"
                  Value="{StaticResource SelectedNoFocusBackgroundBrush}"/>
              <Setter Property="Foreground" Value="{StaticResource SelectedForegroundBrush}"/>
            </MultiTrigger>
            <Trigger Property="IsEnabled" Value="false">
              <Setter Property="Foreground"
                      Value="{StaticResource DisabledForegroundBrush}"/>
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
</ResourceDictionary>